import * as types from '../types'
import  api from '../../fetch/api'


const state = {
    house_imgdata:[],
    houseinfo:[],
    HouseMasterInfodata:[],
    ShortPricesdata:[],
    ShortPricesTimedata:[]
}

const actions = {
    getLongInfo({ commit },data) {
		commit(types.HOUSE_LONG_INFO, data);
    },
    getShortInfo({ commit },data) {
		commit(types.HOUSE_SHORT_INFO, data);
    },
    setMasterInfo({ commit },data) {
		commit(types.HOUSE_MASTER_INFO, data);
    },
    setShortPrices({ commit },data) {
		commit(types.HOUSE_GETSHORT_PRICES, data);
    },
    setShortPricestime({ commit },data) {
		commit(types.HOUSE_GETSHORT_PRICESTIME, data);
    }
}

const getters = {
    house_imgdata:state=>state.house_imgdata,
    houseinfo:state=>state.houseinfo,
    HouseMasterInfodata:state=>state.HouseMasterInfodata,
    ShortPricesdata:state=>state.ShortPricesdata,
    ShortPricesTimedata:state=>state.ShortPricesTimedata,
}

const mutations = {
	[types.HOUSE_LONG_INFO](state, res) {
		state.house_imgdata = res
	},
	[types.HOUSE_SHORT_INFO](state, res) {
		state.houseinfo = res
	},
	[types.HOUSE_MASTER_INFO](state, res) {
		state.HouseMasterInfodata = res
	},
	[types.HOUSE_GETSHORT_PRICES](state, res) {
		state.ShortPricesdata = res
	},
	[types.HOUSE_GETSHORT_PRICESTIME](state, res) {
		state.ShortPricesTimedata = res
	},
}


export default {
    state,
    actions,
    getters,
    mutations
}